<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:pgh="http://tecnologie-web.studenti.math.unipd.it/tecweb/~ccardin/"
    exclude-result-prefixes="pgh">


<xsl:output method='xml' version='1.0' encoding='UTF-8' indent='yes' omit-xml-declaration='yes'/>
    <!-- set the page index -->
    <xsl:variable name="pageId" select="'__PAGEID__'"/>

	<xsl:template match="/">
		<xsl:apply-templates select="pgh:pageheader/pgh:pages/pgh:page[@linkId=$pageId]"/>
	</xsl:template> 
	
	 <xsl:template match="pgh:page">
		<head profile="http://www.w3.org/2005/10/profile">
			<link rel="icon" type="image/png" href="../public_html/images/myicon.png" />
		        <title><xsl:value-of select="pgh:pageTitle"/></title>
			<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
			<meta content="{pgh:pageTitle}" name="title"/>
			<meta content="{pgh:description}" name="description"/>
			<meta>
				<xsl:attribute name="content">
					<xsl:for-each select="pgh:keywords/pgh:keyword">
						<xsl:value-of select="."/>
						<xsl:text> </xsl:text>
					</xsl:for-each>
				</xsl:attribute> 
				<xsl:attribute name="name">
					<xsl:text>keywords</xsl:text>
				</xsl:attribute>
			</meta>
			<meta content="Cardin Christian, Scaboro Andrea, Tesselli Riccardo, Tombolini Stefano, Tosatto Andrea" name="author"/>
			<meta content="english en" name="language"/>
			<xsl:for-each select="pgh:styles/pgh:style">
				<link href="{.}" rel="stylesheet" type="text/css" media="{@media}"/>
		        </xsl:for-each>
			<xsl:for-each select="pgh:scripts/pgh:script">
				<script src="{.}" type="text/javascript">.</script>
		        </xsl:for-each>
		</head>
	</xsl:template>
	
</xsl:stylesheet>
